"use strict";
{
    //布尔类型
    let b = true; //声明并赋值
    b = false;
    b = true;
    // b = '中秋快乐'
    let b2; //声明
    b2 = true; // 赋值
    //数字类型
    let n = 521;
    n = 1314;
    n = 258;
    // n = '123';
    n = 0x77; //十六进制
    n = 0o77; // 八进制
    n = 0b1010; //二进制
    console.log(n);
    //字符串类型   单引号  双引号  反引号
    let s = "中秋快乐~~";
    s = "123";
    //字面量类型
    let z;
    // z = 123;
    // z = 'like';
    z = "love"; //常量
    let z2 = 123;
    //任意类型  为变量设置了 any 类型, 就丧失了代码提示与错误提醒
    //面向 any 编程
    let a;
    a = 100;
    a = "abc";
    a = [1, 2, 3];
    //void 类型  空
    let v;
    // v = 100;
    // v = 100;
    // v = null;
    v = undefined;
    function fn() {
        return;
    }
    //对象类型
    let o;
    o = {};
    o = [];
    o = () => { };
    // o = 123; //不能将类型“number”分配给类型“object”
    //数组类型
    //数字数组
    let arr = [1, 2, 3, 4, 5];
    let arr2 = ["张三", "李四", "王五"];
    arr.push(6);
    //元组
    let arr3 = ["干啥呢??", 45];
    let stu = [
        ["王欣", 18],
        ["刘冉", 18],
        ["笑阳", 10],
    ];
    //枚举类型
    let Gender;
    (function (Gender) {
        Gender["Female"] = "\u5973";
        Gender["Male"] = "\u7537";
        Gender["Secret"] = "\u4FDD\u5BC6";
    })(Gender || (Gender = {}));
    let me = {
        name: "张三",
        gender: Gender.Male,
    };
    console.log(me);
    //联合类型  //number 限制变量的类型
    let u;
    u = 100;
    u = "123";
    u = true;
    // u = [];
    // let arr4: number[] = [1,2,3,4];
    // let res = arr4.find(item => item > 5);
    // console.log(res);
    //类型断言
    let root = document.querySelector("#root"); //类型断言
    root.style.background = "#aef";
    //类型推导
    let t = 100;
    // t = 'abc';
    let t2;
    t2 = 100;
    t2 = "abc";
    t2 = false;
}
